// router.js
import { createBrowserRouter } from 'react-router-dom'
import App from '../App'
import Layout from '../pages/Layout'
import Workplace from '../pages/workplace'
import Dataplace from '../pages/dataplace'
import Processplace from '../pages/processplace'
import Application from '../pages/Application'
import Board from '../pages/board'
import Backup from '../pages/backup'
import Code from '../pages/code'
import Export from '../pages/export'
import Processing from '../pages/processing'
import Rehis from '../pages/rehis'
import Update from '../pages/update'
import Zujian from '../pages/zujian'
import Kuaye from '../pages/kuaye'
import TableEdit from '../pages/kuaye/tableedit'
import SelectPage from '../pages/kuaye/tableselect'
import TableEdit_zujian from '../pages/zujian/tableedit'
import SelectPage_zujian from '../pages/zujian/tableselect'
import TableEdit_pro from '../pages/processing/tableedit'
import SelectPage_pro from '../pages/processing/tableselect'
import TableEdit_code from '../pages/code/tableedit'
import SelectPage_code from '../pages/code/tableselect'
const router = createBrowserRouter([
  {
    path: '/',
    element: <App />, // 根路径显示登录页
  },
  {
    path: '/layout', // 使用全小写路径
    element: <Layout />,
  },
  {
    path: '/workplace', // 使用全小写路径
    element: <Workplace />,
  },
  {
    path: '/dataplace', // 使用全小写路径
    element: <Dataplace />,
  },
  {
    path: '/processplace', // 使用全小写路径
    element: <Processplace />,
  },
  {
    path: '/application', // 使用全小写路径
    element: <Application />,
  },
  {
    path: '/board', // 使用全小写路径
    element: <Board />,
  },
  {
    path: '/backup', // 使用全小写路径
    element: <Backup />,
  },
  {
    path: '/code', // 使用全小写路径
    element: <Code />,
    children: [
      {
        index: true, // 默认子路由
        element: <SelectPage_code />
      },
      {
        path: 'tableedit', // 相对路径 
        element: <TableEdit_code />
      }
    ]
  },
  {
    path: '/export', // 使用全小写路径
    element: <Export />,
  },
  {
    path: '/kuaye', // 使用全小写路径
    element: <Kuaye />,
    children: [
      {
        index: true, // 默认子路由
        element: <SelectPage />
      },
      {
        path: 'tableedit', // 相对路径（实际路径：/kuaye/tableedit）
        element: <TableEdit />
      }
    ]
  },
  {
    path: '/processing', // 使用全小写路径
    element: <Processing />,
      children: [
        {
          index: true, // 默认子路由
          element: <SelectPage_pro />
        },
        {
          path: 'tableedit', // 相对路径 
          element: <TableEdit_pro />
        }
      ]
  },
  {
    path: '/rehis', // 使用全小写路径
    element: <Rehis />,
  },
  {
    path: '/update', // 使用全小写路径
    element: <Update />,
  },
  {
    path: '/zujian', // 使用全小写路径
    element: <Zujian />,
      children: [
        {
          index: true, // 默认子路由
          element: <SelectPage_zujian />
        },
        {
          path: 'tableedit', // 相对路径 
          element: <TableEdit_zujian />
        }
      ]
  },
])
export default router